import { LOAD_NOTICE, CLEAR_NOTICE } from '../actionTypes'
const initialState = [
    {
      title: '你已参加七号足球公园活动',
      content: '小聚场｜您已经成功创建小聚场，快去邀请好友参加吧！',
      time: 1594479168099
    },
    {
      title: '创建小聚场通知',
      content: '小聚场｜您已经成功创建小聚场，快去邀请好友参加吧！',
      time: 1594478225776,
      detail: '详情。。。'

    },
    {
      title: '你已获得蓝色勋章',
      content: 'XXXXXX',
      time: 1594391825000
    }
  ];

export default function(state = initialState, action) {
  switch (action.type) {
    case LOAD_NOTICE: {
        state = {
            ...action.payload.notice
        }
        return Object.assign({},state)
      }
    case CLEAR_NOTICE: {
        return []
    }
    default:
      return state
  }
}
